package com.aspose.cells;

abstract class zagm {
   zaay b;
   zagu c;
   private CellArea a;

   protected zagm(zaay var1, zfv var2, CellArea var3) {
      this.b = new zaay(var1);
      if (var2 != null) {
         this.c = zaaq.a(var2.c, var2.d);
      }

      this.a = var3;
   }

   public abstract com.aspose.cells.a.d.zb a(com.aspose.cells.b.a.b.zq var1, double[] var2, int var3, int var4) throws Exception;

   public abstract boolean c() throws Exception;

   protected void d() {
      zfv var1 = this.b.e.getRows().a.a(this.b.g, new zfv(this.b.h), 4);
      if (var1 == null) {
         this.c = zzk.a;
      } else {
         this.c = zaaq.a(var1.c, var1.d);
      }
   }

   protected zyy a(ConditionalFormattingValue var1) {
      zyy var2;
      if (var1.getType() == 5) {
         var2 = (new zyg(this.b, var1.f(), 0, -1)).a().a(this.b, 0);
         if (var2 != null) {
            var2 = (new zzi(64, zabk.a(328), new zagu[]{new zaal(32, new zaye((zur)null, this.a)), new zyy(var2.k() / 100.0D)})).d(this.b).a(this.b, 0);
            if (var2 != null) {
               return var2;
            }
         }
      } else if (var1.getType() == 4) {
         double var9 = 0.0D;
         double var4 = 0.0D;
         zahn var6 = null;
         if (var1.a != -1.7976931348623157E308D) {
            var9 = var1.a;
         } else {
            var6 = (new zaal(32, new zaye((zur)null, this.a))).a(this.b, false);
            zbpi var7 = new zbpi(false, true);
            zayc.a(var6, var7, this.b, true, true);
            var9 = ((zyy)var7.a()).k();
            var1.a = var9;
         }

         if (var1.b != Double.MAX_VALUE) {
            var4 = var1.b;
         } else {
            if (var6 == null) {
               var6 = (new zaal(32, new zaye((zur)null, this.a))).a(this.b, false);
            }

            zbpj var11 = new zbpj(false, true);
            zayc.a(var6, var11, this.b, true, true);
            var4 = ((zyy)var11.a()).k();
            var1.b = var4;
         }

         zyy var12 = (new zyg(this.b, var1.f(), 0, -1)).a().a(this.b, 0);
         if (var12 != null) {
            return new zyy((var9 - var4) * (var12.k() / 100.0D) + var4);
         }
      } else {
         zahn var8;
         if (var1.getType() == 1 || var1.getType() == 6) {
            if (var1.a == -1.7976931348623157E308D) {
               var8 = (new zaal(32, new zaye((zur)null, this.a))).a(this.b, false);
               zbpi var10 = new zbpi(false, true);
               zayc.a(var8, var10, this.b, true, true);
               var1.a = ((zyy)var10.a()).k();
            }

            return new zyy(var1.a);
         }

         if (var1.getType() == 2 || var1.getType() == 7) {
            if (var1.b == Double.MAX_VALUE) {
               var8 = (new zaal(32, new zaye((zur)null, this.a))).a(this.b, false);
               zbpj var3 = new zbpj(false, true);
               zayc.a(var8, var3, this.b, true, true);
               var1.b = ((zyy)var3.a()).k();
            }

            return new zyy(var1.b);
         }

         if (var1.f() != null) {
            var2 = (new zyg(this.b, var1.f(), 0, -1)).a().a(this.b, 0);
            if (var2 != null) {
               return var2;
            }
         }
      }

      return zyy.a;
   }
}
